package com.qomosoft.mediacodectest;

import android.media.MediaCodec;
import android.media.MediaCodecInfo;

/**
 * Created by robin on 17/11/2017.
 */

public class QMMediaCodec {
    protected int TIMEOUT_USEC = 10000;
    protected MediaCodec mMediaCodec;
    protected MediaCodecInfo mMediaCodecInfo;

    public void release() {
        if (null != mMediaCodec) {
            mMediaCodec.stop();
            mMediaCodec.release();
            mMediaCodec = null;
        }
    }

    public static long getPts(long frameIndex, int frameRate) {
        return 132 + frameIndex * 1000000 / frameRate;
    }

}
